﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ROrganizer.Client;

namespace ROrganizer.UI.Controllers
{
    internal class CredentialsFormController
    {
        private HashCredentials credentials;

        public string Username { get; set; }
        public string Password { get; set; }

        public HashCredentials GetCredentials()
        {
            return this.credentials;
        }

        public bool CanLogin()
        {
            return !String.IsNullOrWhiteSpace(this.Username)
                && !String.IsNullOrWhiteSpace(this.Password);
        }

        public void Login()
        {
            this.credentials = new HashCredentials(this.Username, this.Password);
        }

        public void CreateAccount(IWin32Window owner)
        {
            ViewManager.ShowCreateUser(owner);
        }
    }
}
